<script>
/*
 * @Author: wzh 
 * @Date: 2020-12-30 19:34:10 
 * @Last Modified by: 1521620993@qq.com
 * @Last Modified time: 2020-12-30 19:43:08
 */
</script>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>05-相邻盒子的外边距合并</title>
</head>
<body>
  <!-- <style>
    body{
      margin: 0;
      padding: 0;
    }
    div{
      height: 100px;
      background-color: red;
      margin: 30px 0;
    }
    .box1{
      margin-bottom: 50px;
    }
  </style>
  <div class="box1"></div>
  <div class="box2"></div>
  <div class="box3"></div> -->

  <style>
    body{
      margin: 0;
      padding: 0;
    }
    .parent{
      height: 150px;
      background-color: wheat;
      margin-top: 30px;
      /* border: 1px solid red; */
      /* padding: 1px; */
      padding-top: 50px;
    }
    .child{
      height: 50px;
      background-color: magenta;
      /* margin-top: 50px; */
    }
  </style>
  <div class="parent">
    <div class="child"></div>
  </div>
</body>
</html>